<template>
  <div id='device'>
    <el-table v-loading="loading" height="500" :data="data" border>
      <el-table-column label="接入时间" width="150" show-overflow-tooltip align="center" prop="accessTime" />
      <!-- <el-table-column label="台网代码" align="center" prop="" />
      <el-table-column label="台站代码" align="center" prop="" /> -->
      <el-table-column label="设备序列号" align="center" show-overflow-tooltip prop="deviceCode" />
      <el-table-column label="站点名称" align="center" show-overflow-tooltip prop="siteName" />
      <el-table-column label="软件版本" align="center" show-overflow-tooltip prop="version" />
      <el-table-column label="设备类型" align="center" show-overflow-tooltip prop="deviceTypeLabel" />
      <el-table-column label="用户名" align="center" show-overflow-tooltip prop="userName" />
      <el-table-column label="用户密码" align="center" show-overflow-tooltip prop="password" />
    </el-table>

    <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize" @pagination="getList" />
  </div>
</template>

<script>
import { getDevice } from '@/api/password/password';
export default {
  name: 'device',
  components: {},
  props: {
    row: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {
      data: [],
      total: 0,
      loading: true,
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        auId: null,
      },
    };
  },
  computed: {},
  created() {
    // if (process.client){}
  },
  mounted() {
    this.getList();
  },
  beforeCreate() {},
  beforeMount() {},
  methods: {
    async getList() {
      console.log(this.row);
      this.queryParams.auId = this.row.auId;
      const res = await getDevice(this.queryParams);
      if (res.code == 200) {
        this.data = res.rows;
        this.total = res.total;
        this.loading = false;
      }
    },
  },
};
</script>
<style lang='scss' scoped>
#device {
  width: 100%;
  height: 100%;
}
</style>